package tech.lingrui.mnpanonymousservice.model.message;

import lombok.Getter;
import lombok.Setter;
import tech.lingrui.mnpanonymousservice.model.bean.GameModel;
import tech.lingrui.mnpanonymousservice.model.bean.UserModel;

@Getter
@Setter
/**
 *游戏初始化时的相关消息
 * */
public class GameInfoMessage {

    /**
     *游戏id
     * */
    private String gameId;
    /**
     * 比赛的创建者
     * */
    private UserModel creator;

    /**
     * 比赛的参与者
     * */
    private UserModel participant;


    /**
     *获胜者可获积分数量
     * */
    private int winnerIntegral;


    /**
     *失败者失去积分数量
     * */
    private int loserIntegral;


    /**
     * 题量/回合数
     * */
    private int queNum;



    public GameInfoMessage(GameModel gameModel){
        this.creator = gameModel.getCreator();
        this.participant = gameModel.getParticipant();
        this.queNum = gameModel.getRounds().size();
        this.gameId = gameModel.getId();
        this.loserIntegral = gameModel.getLoserIntegral();
        this.winnerIntegral = gameModel.getWinnerIntegral();
    }
}
